package org.noranj.client;

import java.io.InputStream;
import java.net.URL;

import org.apache.cxf.helpers.IOUtils;
import org.apache.cxf.io.CachedOutputStream;

public class RunMe {
  
  public static void main(String args[]) throws Exception {
    URL url = new URL("http://localhost:9000/jbservice/about");
    InputStream in = url.openStream();
    System.out.print(getStringFromInputStream(in).toString());
    
  }
  
  private static String getStringFromInputStream(InputStream in) throws Exception {
    CachedOutputStream bos = new CachedOutputStream();
    IOUtils.copy(in, bos);
    in.close();
    bos.close();
    return ">>>>\r\n"+bos.getOut().toString()+"\r\n-----------------------------------------------------------";
  }
}
